package edu.ccut.saturn.component;

/**
 * Record a parameter information in the *.component, *.action or *.logic file.
 * include validate information for parameter
 * 
 * <p>
 * Parameter has four scope:
 * <li>1. SCOPE_APPLICATOIN : globe parameter
 * <li>2. SCOPE_SESSION : in a session parameter
 * <li>3. SCOPE_REQUEST: in a request parameter
 * <li>4. SCOPE_LOGIC: in a logic or action process parameter
 * 
 * <p>
 * Parameter has three passing type:
 * <li>1. TYPE_IN : input parameter
 * <li>2. TYPE_OUT : output parameter
 * <li>3. TYPE_IN_OUT : input and output parameter
 * 
 * @author LeslieGu
 */
public interface IParameterInfo extends Comparable<IParameterInfo>,
		XmlSerializable {

	public static final int SCOPE_APPLICATOIN = 10;

	public static final int SCOPE_SESSION = 5;

	public static final int SCOPE_REQUEST = 2;

	public static final int SCOPE_LOGIC = 1;

	public static final String PASSING_IN = "in";

	public static final String PASSING_OUT = "out";

	public static final String PASSING_IN_OUT = "in-out";

	public static final String PASSING_UNDEFINE = "undefine";

	/**
	 * Get parameter id, use to sort
	 * 
	 * @return
	 */
	public String getId();

	/**
	 * Get parameter name
	 * 
	 * @return
	 */
	public String getName();

	/**
	 * Get parameter value class type
	 * 
	 * @return
	 */
	public Class<?> getClassType();

	/**
	 * Get parameter passing type
	 * 
	 * @return
	 */
	public String getPassingType();

	/**
	 * Get parameter description
	 * 
	 * @return
	 */
	public String getDescription();

	/**
	 * Get parameter value key
	 * 
	 * @return
	 */
	public String getValueKey();

	/**
	 * Get parameter scope
	 * 
	 * @return
	 */
	public int getScope();

	/**
	 * 获得参数的验证信息
	 * 
	 * @return
	 */
	public IValidateUseInfo getValidateUses();
	/**
	 * 设置参数的验证信息
	 * 
	 * @return
	 */
	public void setValidateUses(IValidateUseInfo validateUseInfo);
}
